//
//  ZXLoginModel.m
//  ZhuoxinAgriculture
//
//  Created by stone on 16/11/30.
//  Copyright © 2016年 stone. All rights reserved.
//

#import "ZXLoginModel.h"
#import "JKDBHelper.h"
@implementation ZXLoginModel

+ (NSDictionary *)objectClassInArray {
    return @{ @"result" : [LoginResult class] };
}

@end
@implementation LoginResult

+ (NSDictionary *)objectClassInArray {
    return @{ @"busRepList" : [LoginBusRepVo class] };
}
-(void)setUserId:(NSString *)userId{
    _userId = userId;
    
    [[JKDBHelper shareInstance] changeDBWithDirectoryName:[NSString stringWithFormat:@"JKDB%@",userId]];
    
}
-(void)setUserType:(NSString *)userType{
    _userType = userType;
    _role = userType;
    NSLog(@"=================================================================");
    switch (userType.integerValue) {
        case 1:
            _usertypename = @"小农";
            NSLog(@"_usertypename = %@",_usertypename);
            break;
        case 2:
            _usertypename = @"农场员工";
            NSLog(@"_usertypename = %@",_usertypename);
            break;
        case 3:
            _usertypename = @"散户";
            NSLog(@"_usertypename = %@",_usertypename);
            break;
        case 4:
            _usertypename = @"决策者";
            NSLog(@"_usertypename = %@",_usertypename);
            break;
        case 5:
            _usertypename = @"联社业务代表";
            NSLog(@"_usertypename = %@",_usertypename);
            break;
        case 6:
            _usertypename = @"组织业务代表";
            NSLog(@"_usertypename = %@",_usertypename);
            break;
            
        default:
            _usertypename = @"小农";
            break;
    }
    NSLog(@"=================================================================");
}

@end

@implementation LoginBusRepVo

@end
